package com.example.ad.sdk.domain.ad.repositories

import com.alibaba.fastjson2.JSONObject
import com.example.ad.sdk.domain.ad.AdRequestParam
import com.example.ad.sdk.domain.repositories.base.BaseRepository

class AdRepository(private val apiService: AdApiService)  : BaseRepository() {
    suspend fun getAd( channel: String, ad: AdRequestParam) = execute {
        val params = JSONObject()
        params["channel"] = channel
        params["count"] = ad.count
        apiService.getAd(params.toJSONString(), AdRequestParam(1))
    }

}